﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace WebFormsBinder.ControlWrappers
{
    public class StringTextBox : IControlWrapper<string, TextBox>
    {
        public string GetValue(TextBox control)
        {
            return control.Text;
        }

        public void SetValue(TextBox control, string value)
        {
            control.Text = value;
        }

        public string JSValue(TextBox control)
        {
            return string.Format("document.getElementById('{0}').value", control.ClientID);
        }

        public string JSTypeValidationCondition(TextBox control)
        {
            return null;
        }

        public string JSElement(TextBox control)
        {
            return string.Format("document.getElementById('{0}')", control.ClientID);
        }
    }
}
